<template>
	<uv-popup ref="popupRef" closeable mode="bottom" round="28rpx">
		<view class="programme-pop">
			<view class="title">预约下单</view>
			<Progranmme :list="schemes" :curren="curren" @change="currenChange" />
			<view class="submit">
				<button class="cu-btn" @click="handSubmit">确认选中</button>
			</view>
		</view>
	</uv-popup>
</template>

<script setup>
	import {
		reactive,
		ref,
		defineProps,
		inject
	} from 'vue'
	import Progranmme from './Progranmme.vue'
	defineProps({
		schemes: {
			type: Array,
			default: () => []
		}
	})
	const curren = inject('curren')
	const currenChange = inject('currenChange')

	const handSubmit = () => {
		handClose()
	}

	const popupRef = ref(null)
	const handOpen = () => {
		popupRef.value.open()
	}
	const handClose = () => {
		popupRef.value.close()
	}
	defineExpose({
		handOpen
	})
</script>

<style lang="scss" scoped>
	.programme-pop {
		padding: 24rpx;
		padding-bottom: 58rpx;
		padding-bottom: calc(constant(safe-area-inset-bottom) + 58rpx);
		padding-bottom: calc(env(safe-area-inset-bottom) + 58rpx);

		.title {
			text-align: center;
			font-size: 36rpx;
			font-family: PingFang SC-Bold, PingFang SC;
			font-weight: bold;
			color: #333333;
		}

		.form {
			margin-top: 64rpx;

			&-item {
				display: flex;

				&:not(:first-child) {
					margin-top: 60rpx;
				}

				.label {
					font-size: 30rpx;
					font-family: PingFang SC-Regular, PingFang SC;
					font-weight: 400;
					color: #333333;
				}

				.value {
					flex: 1;
					margin-left: 20rpx;
					display: flex;
					justify-content: flex-end;

					.place {
						font-size: 30rpx;
						font-family: PingFang SC-Regular, PingFang SC;
						font-weight: 400;
						color: #999999;
					}

					.fangan {
						text-align: right;
						font-size: 30rpx;
						font-family: PingFang SC-Bold, PingFang SC;
						font-weight: bold;
						color: #333333;
					}

					.weiqian {
						font-size: 30rpx;
						font-family: PingFang SC-Regular, PingFang SC;
						font-weight: 400;
						color: #999999;

						text {
							&:last-child {
								color: #FF930D;
							}
						}
					}
				}
			}
		}

		.submit {
			margin-top: 25rpx;
			position: relative;
			z-index: 3;

			.cu-btn {
				width: 702rpx;
				height: 100rpx;
				background: #FFC434;
				border-radius: 16rpx;
				font-size: 32rpx;
				font-family: PingFang SC-Bold, PingFang SC;
				font-weight: bold;
				color: #333333;
			}
		}
	}
</style>